﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FileUtil;

namespace util_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("GetModuleFileName() = " + common.GetModuleFileName());
            //string src = "d:\\test\\111";
            //string dst = "d:\\test\\222";

            //Console.WriteLine("CoryFolder = " + common.CoryFolder(src, dst));



            /*
            string path = "c:\\1\\11.txt";

            
            Console.WriteLine("GetExtName = " + common.GetExtName(path));
            Console.WriteLine("GetOnlyFileName = " + common.GetOnlyFileName(path));
            Console.WriteLine("GetFileName = " + common.GetFileName(path));
            Console.WriteLine("GetFileDirectory = " + common.GetFileDirectory(path));
            Console.WriteLine("GetOnlyFileDirectory = " + common.GetOnlyFileDirectory(path));           
            Console.WriteLine("GetDrive = " + common.GetDrive(path));
            Console.WriteLine("IsExistFile = " + common.IsExistFile("c:\\1.txt"));
            
            
            string testPath = "d:\\test\\aaa\\1.txt";
            Console.WriteLine("make directory result = " + common.makeDirectory(testPath));
            Console.WriteLine("IsExistDirectory = " + common.IsExistDirectory(testPath));
            string aaaa = "d\\test\\aaaa\\aaa";
            Console.WriteLine("GetFileDirectory() == " + common.GetFileDirectory(testPath));
            
            
            string path1 = "c:\\test\\1\\1\\1\\1\\1\\";
            string path2 = "c:\\test\\1\\1";

            Console.WriteLine("IsExistDirectory = " + common.IsExistDirectory(path1));

            Console.WriteLine("make directory result = " + common.makeDirectory(path1));

            Console.WriteLine("IsExistDirectory = " + common.IsExistDirectory(path1));

            Console.WriteLine("rmDirectory = " + common.rmDirectory(path2, false));
            Console.WriteLine("IsExistDirectory = " + common.IsExistDirectory(path2));


            string filePath = "c:\\test\\111\\park.txt";

            List<string> contents = new List<string>();
            contents.Add("가나다라");
            contents.Add("마바사아");
            contents.Add("자카타파하");

            Console.WriteLine("WriteFileList = " + common.WriteFileList(filePath, ref contents, Encoding.UTF8));
            List<string> tmpConents = new List<string>();
            Console.WriteLine("readFileList = " + common.readFileList(filePath, ref tmpConents, Encoding.UTF8));
            
            Console.WriteLine("WriteFileList = " + common.WriteFileList(filePath, ref contents, Encoding.UTF8, true));
            List<string> tmpConents1 = new List<string>();
            Console.WriteLine("readFileList = " + common.readFileList(filePath, ref tmpConents1, Encoding.UTF8));
            
            foreach (string aa in tmpConents)
            {
                Console.WriteLine(aa);
            }

            Console.WriteLine("WriteFileList = " + common.WriteFileList(filePath, ref contents, Encoding.UTF8));
            List<string> tmpConents2 = new List<string>();
            Console.WriteLine("readFileList = " + common.readFileList(filePath, ref tmpConents2, Encoding.UTF8));

            Console.WriteLine("==========================================================");

            foreach (string aa in tmpConents1)
            {
                Console.WriteLine(aa);
            }
            Console.WriteLine("==========================================================");


            foreach (string aa in tmpConents1)
            {
                Console.WriteLine(aa);
            }
            Console.WriteLine("==========================================================");
            foreach (string aa in tmpConents2)
            {
                Console.WriteLine(aa);
            }
            Console.WriteLine("==========================================================");
            */

            //WriteLine("make directory result = " + common.makeDirectory("c:\\test\\1\\1\\1\\1\\1\\"));

            /*
            Console.WriteLine("{0}", 5.Multiplication(2, 3));
            Console.WriteLine("{0}", 5.Multiplication(2));

            aaa a = new aaa();
            a.test();
            a.test1();
            a.test2();
            */

            /*
            OuterClass outer = new OuterClass();
            OuterClass.InnerClass inner = new OuterClass.InnerClass(outer);

            inner.ShowVariable();
            inner.AccessVariable(60);
            inner.ShowVariable();
            */
            /*
            aaa a = new aaa();
            a.fffff = "ff";
            Console.WriteLine("ff = " + a.fffff);

            Myname myName = new Myname();

            string tmp = "aaaaa";
            string tmp1 = "bbbb";


            myName.aaa = tmp;
            myName.aaa1 = tmp1;
            Console.WriteLine("aaaaa = " + myName.aaa);
            Console.WriteLine("bbbb = " + myName.aaa1);

            

            myName.Swap<string>(ref tmp, ref tmp1);

            Console.WriteLine("======================");
            
            Console.WriteLine("aaaaa = " + tmp);
            Console.WriteLine("bbbb = " + tmp1);
            */
        }
    }
}
